import React, { useState } from 'react';
import { NavBar, Space, Toast } from 'antd-mobile';
import { Cell, Video } from '@nutui/nutui-react';
import { history } from 'umi';
import './index.scss';
export default function index() {
  const back = () => {
    history.goBack();
  };
  const [source, setSource] = useState({
    src: 'https://res.yingdashi.cn/template/video/V76b7OIFmc.mp4',
    type: 'video/mp4',
  });
  const options = {
    autoplay: true,
    muted: true,
    controls: true,
  };
  const play = (elm) => console.log('play', elm);
  const pause = (elm) => console.log('pause', elm);
  const playend = (elm) => console.log('playend', elm);
  return (
    <>
      <NavBar onBack={back}>婚礼现场</NavBar>
      <div className="text">欢迎来参加我们的婚礼</div>
      <div>
        <Cell className="cell">
          <Video
            source={source}
            options={options}
            onPlayFuc={play}
            onPauseFuc={pause}
            onPlayend={playend}
          />
        </Cell>
      </div>
    </>
  );
}
